<div class="wrap">
    <div id="icon-upload" class="icon32"><br></div>
    <h2>Vysílací plán <a href="{link target='self:addSlide'}" class="add-new-h2">Přidat snímek</a> </h2>
    {include file="messages.tpl"} 
    <ul class="subsubsub">
        <li><a href="{link target='self:defaultAction'}"{if !isset($smarty.get.status_valid)} class="current"{/if}>Celkem <span class="count">({$cnt.all})</span></a> |</li>
        <li><a href="{link target='self:defaultAction' status_valid='now'}"{if $smarty.get.status_valid == 'now'} class="current"{/if}>Aktuální <span class="count">({$cnt.now})</span></a> |</li>
        <li><a href="{link target='self:defaultAction' status_valid='future'}"{if $smarty.get.status_valid == 'future'} class="current"{/if}>Budoucí <span class="count">({$cnt.future})</span></a> |</li>
        <li><a href="{link target='self:defaultAction' status_valid='past'}"{if $smarty.get.status_valid == 'past'} class="current"{/if}>Minulé <span class="count">({$cnt.past})</span></a></li>
    </ul>
    <form id="posts-filter" action="{link target='self:defaultBulkAction'}" method="post">
        <input name="token" type="hidden" value="{wp_nonce target='self:defaultBulkAction'}" />
        <div class="tablenav top">
            <div class="alignleft actions">
                <select name="action1">
                    <option value="-1" selected="selected">Hromadné úpravy</option>
                    <option value="remove">Odstranit</option>
                </select>
                <input type="submit" name="" id="doaction" class="button-secondary action" value="Použít">
            </div>
            {include file="pager.tpl" position='top' pager=$pager page='defaultAction' append='orderBy,order'}
            <br class="clear">
        </div>
        <table class="wp-list-table widefat fixed pages" cellspacing="0">
            <thead>
                <tr>
                    <th scope="col" id="cb" class="manage-column column-cb check-column" style="">
                        <input type="checkbox">
                    </th>                    
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='name'}" style="width: 350px">
                        <a href="{sortlink orderBy='name' append='paged'}"><span>Název</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='post_title'}" style="">
                        <a href="{sortlink orderBy='post_title' append='paged'}"><span>Rozložení</span><span class="sorting-indicator"></span></a>
                    </th>                    
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='validFrom'}">
                        <a href="{sortlink orderBy='validFrom' append='paged'}"><span>Platnost od</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='validTo'}">
                        <a href="{sortlink orderBy='validTo' append='paged'}"><span>Platnost do</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='position'}" style="width: 70px">
                        <a href="{sortlink orderBy='position' append='paged'}"><span>Pozice</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th></th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <th scope="col" id="cb" class="manage-column column-cb check-column" style="">
                        <input type="checkbox">
                    </th>                    
                    <th scope="col" class="manage-column column-title sortable desc" style="">
                        <a href="#"><span>Název</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title sortable desc" style="">
                        <a href="#"><span>Rozložení</span><span class="sorting-indicator"></span></a>
                    </th>                     
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='validFrom'}">
                        <a href="{sortlink orderBy='validFrom' append='paged'}"><span>Platnost od</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title {sortstate orderedBy='validTo'}">
                        <a href="{sortlink orderBy='validTo' append='paged'}"><span>Platnost do</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th scope="col" class="manage-column column-title sortable desc" style="">
                        <a href="#"><span>Pozice</span><span class="sorting-indicator"></span></a>
                    </th>
                    <th></th>
                </tr> 
            </tfoot>
            <tbody id="the-list">
                {foreach $slides as $slide} 
                <tr class="{cycle values='alternate,'}" valign="top">
                    <th scope="row" class="check-column"><input type="checkbox" name="post[]" value="{$slide.slideId}"></th>
                    <td class="post-title page-title column-title">
                        <strong>
                            <a class="row-title" href="{link target='self:editSlide' slideId=$slide.slideId}" title="Upravit „{$slide.name|escape}“">{$slide.name|escape}</a>
                        </strong>
                        <div class="row-actions">
                            <span class="edit"><a href="{link target='self:editSlide' slideId=$slide.slideId}" title="Upravit tuto položku">Upravit</a> | </span>
                            <span class="edit"><a href="{link target='self:editItems' slideId=$slide.slideId}" title="Upravit datové rámce">Upravit rámce</a> | </span>                            
                            <span class="trash"><a class="submitdelete" title="Přesunout tuto položku do koše" href="{link target='self:removeSlide' slideId=$slide.slideId token='true'}">Odstranit</a></span>
                    </td>
                    <td class="post-title page-title column-title">
                       {$slide.post_title|escape}
                    </td>                    
                    <td class="post-title page-title column-title">
                       {$slide.validFrom|escape}
                    </td>
                    <td class="post-title page-title column-title">
                       {$slide.validTo|escape}
                    </td>
                    <td class="post-title page-title column-title">
                       {$slide.position|escape}
                    </td>
                    <td class="post-title page-title column-title">                        
                        {if $slide.position < count($slides)}
                        <a href="{link target='self:increaseSlidePosition' slideId=$slide.slideId}" class="ctrl icoArrowDown">Dolů</a>
                        {/if}
                        {if $slide.position > 1}
                        <a href="{link target='self:decreaseSlidePosition' slideId=$slide.slideId}" class="ctrl icoArrowUp">Nahoru</a>
                        {/if}
                    </td>
                </tr>
                {foreachelse}
                <tr>
                    <td colspan="6">Není zadáno žádné vysílací schéma.</td>
                </tr>
                {/foreach}
            </tbody>
        </table>
        <div class="tablenav bottom">
            <div class="alignleft actions">
                <select name="action2">
                    <option value="-1" selected="selected">Hromadné úpravy</option>
                    <option value="remove">Odstranit</option>
                </select>
                <input type="submit" name="" class="button-secondary action" value="Použít">
            </div>
            <div class="alignleft actions">
            </div>
            {include file="pager.tpl" pager=$pager page='defaultAction' append='orderBy,order'}
            <br class="clear">
        </div>
    </form>
</div>
